<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ListCustomerTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
           
             <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_idCustomer}" for="idCustomer" />
                    <h:inputText id="idCustomer" value="#{customerController.selected.idCustomer}" title="#{bundle.CreateCustomerTitle_idCustomer}" required="true" requiredMessage="#{bundle.CreateCustomerRequiredMessage_idCustomer}"/>
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_customerCode}" for="customerCode" />
                    <h:inputText id="customerCode" value="#{customerController.selected.customerCode}" title="#{bundle.CreateCustomerTitle_customerCode}" required="true" requiredMessage="#{bundle.CreateCustomerRequiredMessage_customerCode}"/>
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_customerName}" for="customerName" />
                    <h:inputText id="customerName" value="#{customerController.selected.customerName}" title="#{bundle.CreateCustomerTitle_customerName}" required="true" requiredMessage="#{bundle.CreateCustomerRequiredMessage_customerName}"/>
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_phone}" for="phone" />
                    <h:inputText id="phone" value="#{customerController.selected.phone}" title="#{bundle.CreateCustomerTitle_phone}" />
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_address}" for="address" />
                    <h:inputText id="address" value="#{customerController.selected.address}" title="#{bundle.CreateCustomerTitle_address}" />
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_balance}" for="balance" />
                    <h:inputText id="balance" value="#{customerController.selected.balance}" title="#{bundle.CreateCustomerTitle_balance}" />
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_other}" for="other" />
                    <h:inputText id="other" value="#{customerController.selected.other}" title="#{bundle.CreateCustomerTitle_other}" />
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_tempFlag}" for="tempFlag" />
                    <h:inputText id="tempFlag" value="#{customerController.selected.tempFlag}" title="#{bundle.CreateCustomerTitle_tempFlag}" />
                </h:panelGrid>
                <br />
                <h:commandLink action="#{customerController.create}" value="#{bundle.CreateCustomerSaveLink}" />
                <br />
                <br />
            </h:form>
           
           
            <h:form styleClass="jsfcrud_list_form">
               
                <h:outputText escape="false" value="#{bundle.ListCustomerEmpty}" rendered="#{customerController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{customerController.items.rowCount > 0}">
                    <h:outputText value="#{customerController.pagination.pageFirstItem + 1}..#{customerController.pagination.pageLastItem + 1}/#{customerController.pagination.itemsCount}"/>&nbsp;
                    <h:commandLink action="#{customerController.previous}" value="#{bundle.Previous} #{customerController.pagination.pageSize}" rendered="#{customerController.pagination.hasPreviousPage}"/>&nbsp;
                    <h:commandLink action="#{customerController.next}" value="#{bundle.Next} #{customerController.pagination.pageSize}" rendered="#{customerController.pagination.hasNextPage}"/>&nbsp;
                    <h:dataTable value="#{customerController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListCustomerTitle_idCustomer}"/>
                            </f:facet>
                            <h:outputText value="#{item.idCustomer}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListCustomerTitle_customerCode}"/>
                            </f:facet>
                            <h:outputText value="#{item.customerCode}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListCustomerTitle_customerName}"/>
                            </f:facet>
                            <h:outputText value="#{item.customerName}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListCustomerTitle_phone}"/>
                            </f:facet>
                            <h:outputText value="#{item.phone}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListCustomerTitle_address}"/>
                            </f:facet>
                            <h:outputText value="#{item.address}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListCustomerTitle_balance}"/>
                            </f:facet>
                            <h:outputText value="#{item.balance}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListCustomerTitle_other}"/>
                            </f:facet>
                            <h:outputText value="#{item.other}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListCustomerTitle_tempFlag}"/>
                            </f:facet>
                            <h:outputText value="#{item.tempFlag}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="&nbsp;"/>
                            </f:facet>
                            <h:commandLink action="#{customerController.prepareView}" value="#{bundle.ListCustomerViewLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{customerController.prepareEdit}" value="#{bundle.ListCustomerEditLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{customerController.destroy}" value="#{bundle.ListCustomerDestroyLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{customerController.bills}" value="#{bundle.getBills}"/>
                        </h:column>
                    </h:dataTable>
                </h:panelGroup>
                <br />
                <h:commandLink action="#{customerController.prepareCreate}" value="#{bundle.ListCustomerCreateLink}"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.ListCustomerIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
